/*
 * @Author: linZeJian
 * @Date: 2022-01-27 15:47:50
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-02-21 09:17:08
 * @Description: 
 */
import { fileURLToPath, URL } from 'url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  base: "/basePath",
  plugins: [vue()],
  server: {
    host: '0.0.0.0',
    port: 3016,
    proxy: {
      // 代理
      '/api': {
        target: `http://www.phonegap100.com/`,
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
    },
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})
